package com.ruoyi.project.roadnet.baseRoadwaysection.service;

import java.util.List;

import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.roadnet.baseRoadwaysection.domain.BaseRoadway;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.roadnet.baseRoadwaysection.mapper.BaseRoadwaysectionMapper;
import com.ruoyi.project.roadnet.baseRoadwaysection.domain.BaseRoadwaysection;
import com.ruoyi.project.roadnet.baseRoadwaysection.service.IBaseRoadwaysectionService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 路段 服务层实现
 * 
 * @author zhangdachen
 * @date 2019-04-12
 */
@Service
public class BaseRoadwaysectionServiceImpl implements IBaseRoadwaysectionService 
{
	@Autowired
	private BaseRoadwaysectionMapper baseRoadwaysectionMapper;

	/**
     * 查询路段信息
     * 
     * @param id 路段ID
     * @return 路段信息
     */
    @Override
	public BaseRoadwaysection selectBaseRoadwaysectionById(Integer id)
	{
	    return baseRoadwaysectionMapper.selectBaseRoadwaysectionById(id);
	}
	
	/**
     * 查询路段列表
     * 
     * @param baseRoadwaysection 路段信息
     * @return 路段集合
     */
	@Override
	public List<BaseRoadwaysection> selectBaseRoadwaysectionList(BaseRoadwaysection baseRoadwaysection)
	{
	    return baseRoadwaysectionMapper.selectBaseRoadwaysectionList(baseRoadwaysection);
	}
	/**
	 * 查询道路列表
	 *
	 * @param baseRoadway 道路信息
	 * @return 路段集合
	 */
	@Override
	@DataScope(tableAlias = "d")
	public List<BaseRoadway> selectBaseRoadwayList(BaseRoadway baseRoadway)
	{
		return baseRoadwaysectionMapper.selectBaseRoadwayList(baseRoadway);
	}

	/**
	 * 按roadcode选择路段列表
	 * @param roadcode
	 * @return
	 */
	@Override
	public  List<BaseRoadwaysection> selectBaseRoadwaysectionListByRoadCode(String roadcode){
		return  baseRoadwaysectionMapper.selectBaseRoadwaysectionListByRoadCode(roadcode);
	}


    /**
     * 新增路段
     * 
     * @param baseRoadwaysection 路段信息
     * @return 结果
     */
	@Override
	public int insertBaseRoadwaysection(BaseRoadwaysection baseRoadwaysection)
	{
	    return baseRoadwaysectionMapper.insertBaseRoadwaysection(baseRoadwaysection);
	}
	
	/**
     * 修改路段
     * 
     * @param baseRoadwaysection 路段信息
     * @return 结果
     */
	@Override
	public int updateBaseRoadwaysection(BaseRoadwaysection baseRoadwaysection)
	{
	    return baseRoadwaysectionMapper.updateBaseRoadwaysection(baseRoadwaysection);
	}

	/**
     * 删除路段对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteBaseRoadwaysectionByIds(String ids)
	{
		return baseRoadwaysectionMapper.deleteBaseRoadwaysectionByIds(Convert.toStrArray(ids));
	}
	
}
